home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / os2 / pc2_140.zip / SOURCE.ZIP / Source / PC2.h < prev    next >
Text File  |  1993-04-17  |  14KB  |  282 lines

  1. /***********************************************************************\
  2.  *                                PC2.c                                *
  3.  *                 Copyright (C) by Stangl Roman, 1993                 *
  4.  * This Code may be freely distributed, provided the Copyright isn't   *
  5.  * removed, under the conditions indicated in the documentation.       *
  6.  *                                                                     *
  7.  * PC2.h        Program Commander/2 header file.                       *
  8.  *                                                                     *
  9. \***********************************************************************/
  10.  
  11. #ifndef IPFC                            /* Don't include if we compile HLP files */
  12. #define         INCL_WIN                /* Environment include files */
  13. #define         INCL_DOS
  14. #define         INCL_DOSERRORS
  15. #include        <os2.h>
  16.  
  17. #include        <stdio.h>               /* C Set/2 include files */
  18. #include        <stdlib.h>
  19. #include        <string.h>
  20. #include        <ctype.h>
  21. #endif
  22.  
  23. #define         EF_SIZE60       60
  24. #define         EF_SIZE255      255
  25.  
  26.                                         /* Define an additional session type of WPS object
  27.                                            representing any object */
  28. #define         SSF_TYPE_WPSOBJECT      21
  29.  
  30. typedef void (EXPENTRY PFFUNCPTR1)(ULONG ulC, HWND hD, HWND hP);
  31. typedef BOOL (EXPENTRY PFFUNCPTR2)(HAB hab, PQMSG pqmsg, ULONG option);
  32. typedef struct _SESSIONDATA             SESSIONDATA;
  33. typedef struct _MENUDATA                MENUDATA;
  34. typedef struct _COMMANDLINEPARAMS       COMMANDLINEPARAMS;
  35.  
  36. #define         ENTRYSUBMENU    0
  37. #define         ENTRYMENUITEM   1
  38. #define         ENTRYEMPTY      2
  39.  
  40. struct _SESSIONDATA                     /* Control structure to start a new session */
  41. {
  42. ULONG           id;                     /* Session ID for menu ressources */
  43. UCHAR           PgmTitle[EF_SIZE60+1];  /* Session title */
  44. UCHAR           PgmName[EF_SIZE255+1];  /* Session path and filename */
  45.                                         /* Session working directory */
  46. UCHAR           PgmDirectory[EF_SIZE255+1];
  47.                                         /* Session parameter */
  48. UCHAR           PgmInputs[EF_SIZE255+1];
  49. UCHAR           PgmDosSettings[2049];   /* DOS Settings for DOS sessions */
  50. USHORT          SessionType;            /* Session type */
  51. USHORT          PgmControl;             /* Session control */
  52. USHORT          FgBg;                   /* Start session in foreground/background */
  53. USHORT          InitXPos;               /* X position */
  54. USHORT          InitYPos;               /* Y position */
  55. USHORT          InitXSize;              /* X size */
  56. USHORT          InitYSize;              /* Y size */
  57. ULONG           PriorityClass;          /* Priority of started session */
  58. LONG            PriorityDelta;          /* Delta priority of started session */
  59. };
  60.  
  61. struct _MENUDATA                        /* Control structure to build popup menu */
  62. {
  63. USHORT          Item;                   /* MENUITEM or SUBMENU */
  64. HWND            hwndItem;               /* Window handle within Popup-Menu */
  65. ULONG           id;                     /* Session ID for menu ressources */
  66. PSZ             PgmTitle;               /* Session title */
  67. PSZ             PgmName;                /* Session path and filename */
  68. PSZ             PgmDirectory;           /* Session working directory */
  69. PSZ             PgmInputs;              /* Session parameter */
  70. PSZ             PgmDosSettings;         /* Session settings for DOS applications */
  71. USHORT          SessionType;            /* Session type */
  72. USHORT          PgmControl;             /* Session control */
  73. USHORT          FgBg;                   /* Start session in foreground/background */
  74. USHORT          InitXPos;               /* X position */
  75. USHORT          InitYPos;               /* Y position */
  76. USHORT          InitXSize;              /* X size */
  77. USHORT          InitYSize;              /* Y size */
  78. ULONG           PriorityClass;          /* Priority of started session */
  79. LONG            PriorityDelta;          /* Delta priority of started session */
  80. MENUDATA        *Back;                  /* Pointer to previous menu */
  81. MENUDATA        *Submenu;               /* Pointer to a submenu */
  82. MENUDATA        *Next;                  /* Pointer to next menu */
  83. };
  84.  
  85. struct  _COMMANDLINEPARAMS
  86. {
  87. UCHAR           ucPBefore[EF_SIZE60+1]; /* Parameters before user requested parameter */
  88. UCHAR           ucPUser[128];           /* User requested parameter */
  89. UCHAR           ucPAfter[EF_SIZE60+1];  /* Parameters after user requested parameter */
  90. };
  91.  
  92. #define ID_PC2MAINWINDOW        256
  93. #define ID_OS2LOGO              257
  94.  
  95. #define PC2_CLASSNAME           "PC2"
  96.  
  97. #define ID_PC2SETUP             300     /* Defines for PopUp Menu, that is popped up after
  98.                                            the user presses mouse button 1 on DESKTOP */
  99. #define ID_CONFIGDIALOG         301     /* User pressed Configure PC/2 */
  100. #define ID_ABOUTDIALOG          302     /* User pressed About PC/2 */
  101. #define ID_EXIT                 303     /* User pressed F3 to exit PC/2 */
  102. #define ID_SHUTDOWN             304     /* User pressed ShutDown OS/2 */
  103.  
  104. #define PIID_PROGRAMDIALOG      500     /* Program installation dialog */
  105. #define PIGRP_PROGRAM           501     /* Program data group */
  106. #define PIEF_PROGRAMTITLE       502
  107. #define PIEF_PATHFILENAME       503
  108. #define PIEF_DIRECTORY          504
  109. #define PIEF_PARAMETERS         505
  110. #define PIEF_DOSSETTINGS        506
  111. #define PIPB_WINFILEDLG         507
  112.  
  113. #define PIGRP_TYPE              510     /* Program type group */
  114. #define PIRB_SHELL              511
  115. #define PIRB_OS2FULLSCREEN      512
  116. #define PIRB_OS2WINDOW          513
  117. #define PIRB_PM                 514
  118. #define PIRB_DOSFULLSCREEN      515
  119. #define PIRB_DOSWINDOW          516
  120. #define PIRB_WPSOBJECT          517
  121.  
  122. #define PIGRP_STYLE             520     /* Program style group */
  123. #define PIRB_DEFAULTSTYLE       521
  124. #define PIRB_MAXIMIZED          522
  125. #define PIRB_MINIMIZED          523
  126. #define PIRB_SIZEPOSITION       524
  127. #define PIRB_INVISIBLE          525
  128. #define PIRB_NOAUTOCLOSE        526
  129. #define PIRB_BACKGROUND         527
  130.  
  131. #define PIGRP_SIZEPOSITION      530     /* User defined size & position */
  132. #define PIEF_X                  531
  133. #define PIEF_Y                  532
  134. #define PIEF_XSIZE              533
  135. #define PIEF_YSIZE              534
  136.  
  137. #define PIGRP_PROCESSPRIORITY   540     /* Process priority */
  138. #define PIRB_IDLETIME           541
  139. #define PIRB_REGULAR            542
  140. #define PIRB_NOCHANGE           543
  141. #define PIRB_TIMECRITICAL       544
  142. #define PIRB_FOREGROUNDSERVER   545
  143. #define PILB_DELTAPRIORITY      546
  144. #define PICB_CHILDPROCESS       547
  145.  
  146. #define PIID_HELP_1             550     /* Help pages */
  147. #define PIID_HELP_2             551
  148. #define PIID_HELP_3             552
  149. #define PIID_HELP_4             553
  150. #define PIID_HELP_5             554
  151. #define PIID_HELP_6             555
  152.  
  153.  
  154. #define ADID_ABOUTDIALOG        600     /* About program dialog */
  155.  
  156. #define CDID_CONFIGDIALOG       700     /* Configuration menu dialog */
  157. #define CDGRP_PROGRAM           701     /* Submenu/Program installation group */
  158. #define CDLB_MENUPROGRAM        702
  159. #define CDID_LEVELUP            703
  160. #define CDID_LEVELDOWN          704
  161. #define CDID_ADDMENU            705
  162. #define CDID_ADDPROGRAM         706
  163. #define CDID_CHANGEENTRY        707
  164. #define CDID_REMOVEENTRY        708
  165. #define CDID_RESORT             709
  166.  
  167. #define CDID_HELP_1             710     /* Help pages */
  168. #define CDID_HELP_2             711
  169.  
  170. #define RDID_RESORTDIALOG       750     /* Resort menuentries dialog */
  171. #define RDPB_MOVE               751     /* Move pushbutton */
  172. #define RDGRP_SOURCEMENU        755     /* Move from menu */
  173. #define RDLB_SOURCEMENU         756
  174. #define RDGRP_DESTINATIONMENU   760     /* Move into menu */
  175. #define RDLB_DESTINATIONMENU    761
  176.  
  177. #define MIID_MENUDIALOG         800     /* Menu installation dialog */
  178. #define MIGRP_PROGRAM           801     /* Menu data group */
  179. #define MIEF_MENUTITLE          802
  180.  
  181. #define MIID_HELP_1             810     /* Help page */
  182.  
  183. #define SDID_SHUTDOWNDIALOG     900     /* OS/2 ShutDown dialog */
  184. #define SDID_SHUTDOWNMESSAGE    901     /* Message diaplayed a ShutDown */
  185.  
  186. #define SUID_STARTUPDIALOG      950     /* Request parameters from user before launching
  187.                                            an application */
  188. #define SUTF_STARTUPINFO        951     /* Info to the user what to do */
  189. #define SUTF_STARTUPPARAMETERS  952     /* Info to the user of current parameters */
  190. #define SUEF_STARTUPPARAMETERS  953     /* Entryfield for user data */
  191.  
  192. #define ID_POPUPMENU            1000    /* ID used by first user entered entry in the 
  193.                                            popup menu. It is incremented by 1 by tracing
  194.                                            through the linked list for each entry (submenu
  195.                                            or menuitem). */
  196. #define USERITEMFIRST           ID_POPUPMENU
  197. #define USERITEMLAST            ID_POPUPMENU+200
  198.  
  199. #define ID_HELP                 2000    /* ID used for HELP panels */
  200. #define MAIN_HELP_TABLE         2001
  201. #define MAIN_HELP_SUBTABLE      2002
  202. #define ID_GENERALHELP          2003
  203. #define ID_CONCEPTSHELP         2004
  204. #define ID_USINGHELP            2005
  205. #define ID_ERRORHELP            2006
  206. #define ID_ERRORHELP_1          2007
  207. #define ID_INSTALLATIONHELP     2008
  208.  
  209.                                         /* New messages for the configuration menu dialog */
  210.                                         /* Load the current level into configuration listbox */
  211. #define WM_LOADPOPUPMENU        WM_USER+1
  212.                                         /* Initialize the input queue hook */
  213. #define WM_LOADHOOK             WM_USER+2
  214.                                         /* Save Popup-Menu to Profile */
  215. #define WM_SAVEPOPUPMENU        WM_USER+3
  216.                                         /* Load Popup-Menu from Profile */
  217. #define WM_SETPOPUPMENU         WM_USER+4
  218.                                         /* Display Popup-Menu on Desktop */
  219. #define WM_POPUPMENU            WM_USER+5
  220.  
  221.                                         /* Insert an item to the linked list */
  222. #define MM_INSERTITEMMENUITEM   WM_USER+6
  223.                                         /* Change the first item of a Submenu to an item */
  224. #define MM_INSERTITEMSUBMENU    WM_USER+7
  225.                                         /* Move an item of a Submenu to another position */
  226. #define MM_MOVEMENUITEM         WM_USER+8
  227.                                         /* ShutDown message to ShutDown dialog */
  228. #define WM_SHUTDOWN             WM_USER+9
  229.                                         /* Program Type configuration of Program Installation
  230.                                            dialog */
  231. #define WM_SETUPPROGRAMTYPE     WM_USER+10
  232.                                         /* Program Priority configuration of Program Installation
  233.                                            dialog */
  234. #define WM_SETUPPROGRAMPRIORITY WM_USER+11
  235.                                         /* Program Size & Position configuration of Program
  236.                                            Installation dialog */
  237. #define WM_SETUPSIZEPOSITION    WM_USER+12
  238.                                         /* Query and set desktop window handle */
  239. #define WM_SETDESKTOPHANDLE     WM_USER+13
  240.  
  241.                                         /* Procedures */
  242. extern int      main(int argc, char *argv[], char *envp[]);
  243. extern BOOL     WinStartUp(HAB *pHab, HMQ *pHmq);
  244. extern BOOL     WinStartHelp(HAB hab, UCHAR *pHelpfile, HWND *pHwndHelp);
  245. extern BOOL     WinCloseDown(HWND *pHwndHelp, HAB *pHab, HMQ *pHmq);
  246. extern void     StartSession(SESSIONDATA *SessionData);
  247. extern BOOL     LoadMenuData2SessionData(BOOL Empty, MENUDATA *pMenuData, SESSIONDATA *pSessionData);
  248. extern BOOL     LoadSessionData2MenuData(MENUDATA *pMenuData, SESSIONDATA *pSessionData);
  249. extern MENUDATA *AllocateMenuData(void);
  250. extern void     LoadMenu(MENUDATA *pMenuData);
  251. extern void     SaveMenu(MENUDATA *pMenuData);
  252. extern MRESULT  SetPopupMenu(ULONG msg, MPARAM mp1, MPARAM mp2);
  253. extern MENUDATA *SearchItem(MENUDATA *pMD, ULONG *id);
  254. extern void     InstallFilename2Dialog(HWND hwndDlg, UCHAR *pucFullFileName, BOOL bObject);
  255. extern void     DisableDialogItem(HWND hwndDlg, USHORT usDialogIDs[], USHORT usItemCount, ULONG ulStyle);
  256.  
  257.                                         /* Window procedures */
  258. extern MRESULT  EXPENTRY PC2_MainWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  259. extern MRESULT  EXPENTRY PI_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  260. extern MRESULT  EXPENTRY PI_SubclassedDialogProcedure(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  261. extern MRESULT  EXPENTRY AD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  262. extern MRESULT  EXPENTRY MI_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  263. extern MRESULT  EXPENTRY CD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  264. extern MRESULT  EXPENTRY SD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  265. extern MRESULT  EXPENTRY SU_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  266. extern MRESULT  EXPENTRY RD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  267.  
  268. extern HAB              hab;            /* Handle of PM anchor block */
  269. extern HMQ              hmq;            /* Handle of message queue */
  270. extern HWND             hwndFrame;
  271. extern HWND             hwndClient;
  272. extern HWND             hwndPopupMenu;  /* Handel of popup menu window */
  273. extern HWND             hwndHelp;
  274. extern SESSIONDATA      SessionData;
  275. extern MENUDATA         *pPopupMenu;    /* First entry of linked list of menus */
  276. extern MENUDATA         *pMenuData;     /* First entry of current level of linked list */
  277. extern USHORT           DialogResult;   /* Result of last dialog */
  278. extern USHORT           MenuDataId;     /* Id of the items in the Popup-Menu and linked list */
  279. extern FILE             *Pc2Profile;    /* Profile filename */
  280. extern SWP              swpScreen;      /* The screen dimensions */
  281.  
  282.